package com.china08.yxyapi.repository.db.huixue.comm;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.china08.yxyapi.entity.db.questionbank.YxyQuesbankBookContents;

public interface YxyQuesbankBookContentsRepository extends JpaRepository<YxyQuesbankBookContents, String> {

    List<YxyQuesbankBookContents> findByBookIdAndStatusAndPIdOrderByOrderNum(String bookid, Integer status, String pid);

    List<YxyQuesbankBookContents> findByPId(String pid);

    @Query(value = "select t1 from YxyQuesbankBookContents t1 where t1.pId = ?1 and t1.status = ?2 order by t1.orderNum,t1.id ")
    List<YxyQuesbankBookContents> findByPIdAndStatus(String newbookContentId, Integer status);

    @Query(value = "select t1 from YxyQuesbankBookContents t1 where t1.bookId = ?1 and t1.status = ?2 and t1.pId=?3 order by t1.orderNum,t1.id ")
    List<YxyQuesbankBookContents> findByBookIdAndStatusAndPId(String book, int i, String string);
}
